package enumandlambda;

/**
 * @author shkstart
 *  Runnable的匿名内部类
 * @create 2022-11-28-13:36
 */
public class ThreadDemo5 {
    public static void main(String[] args) {
//        匿名内部类
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                //业务代码
                Thread t = Thread.currentThread();
                System.out.println(t.getName());
            }
        });
//        启动线程
        thread.start();
    }

}
